package net.zjitc.Utils;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * @Author admin
 * @Date 2019/2/25 10:31
 */
public class C3P0Utils {
    private static DataSource ds= null;
    static {
        ds = new ComboPooledDataSource("mysql");
    }
    public static Connection getConnerction()throws SQLException{
        return ds.getConnection();
    }
    public static DataSource getDataSource(){
        return ds;
    }
}
